/**
 * Created by leo on 16-12-9.
 */

'use strict';

module.exports = function (app) {
  var users = require('../controllers/users.api.server.controller');

  app.route('/api/users/me').get(users.me);
  app.route('/api/users').put(users.update);

  app.route('/api/stories/:storyId/users/:userId')
    .put(users.addUserToStory)
    .delete(users.removeMemberFromStory);

  // Finish by binding the user middleware
  app.param('userId', users.userByID);
};
